package br.ufrj.dcc.ad.model;

/**
 * 
 * Gerador de numeros aleatorios implementado de acordo um slide da aula.
 *
 */
public class RandomGenerator {
	static long b = 16807;
	static int m = Integer.MAX_VALUE;
	static long z;
	
	public static void seed(int seed) {
		z = seed;
	}
	
	public static int nextInt() {
		return (int) (z = b*z % m);
	}
	
	public static double nextDouble() {
		int z = nextInt();
		return 1.0*z / m;
	}
	
}
